<?php
include "includeFiles.php";
if(empty($_SESSION['user_id'])) echo "<script>location.href='login.php';</script>";
include "page.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=7" />

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $C['Title'];?></title>
<Link href="../uploadfile/ico/<?php echo $C['ICO'];?>" rel="Shortcut Icon">
<meta name="Keywords" content="<?php echo $C['Keywords'];?>">
<meta name="description" content="<?php echo $C['Description'];?>">
<Meta name="Copyright" Content="<?php echo $C['CopyRight'];?>">
<link href="css/css.css" rel="stylesheet" type="text/css" />
<link charset="utf-8" rel="stylesheet" href="css/alipay.css">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
</head>
<body id="mainbody">
<?php include_once('header.php');?>
<!--主体布局-->
<div class="main">
<div class="locahostDIv">
<span>当前位置：<a href="index.php">首页</a></span> >

   <a href="in.php?hid=<?=$hid?>&cityid=<?=$cityid?>">
   <? if($hid == 111) echo "3G开户"; else echo "积分商城";?>
   </a> > <a href="in.php?cateid=<?=$cateid?>&cityid=<?=$cityid?>"><?=$alink=$info->getProLinks($cateid)?></a> 
</div>
<div class="contant">
   <div class="left">
   <div class="fen">
      <div class="box">
      <div class="tital">
         <div class="tit"><em>产品分类</em></div>
      </div>
      <div class="main2">
      <div class="sorttab">
        <ul class="tab">
           <?php	
		   if(empty($hid)) $hid = 111;
	$vm=$info->getProMenu($hid);
	if($vm){
	foreach($vm as $key=>$value){
	 ?>
        <li class="l1"><a href="in.php?cateid=<?=$value['SysProCategoryID']?>&cityid=<?=$cityid?>"><?=$value['CateName']?></a></li>
            <? }}?>
        </ul>
    </div>
      </div>
      </div>
      <div class="bot"></div>
   </div>
   
   </div>
   <div class="right">
   <div class="about2">
      <div class="box">
      <div class="main1">
       <ul class="proListUL">
	    <?php
				if($keyword)
				{
					$condition=" and ProductName like '%$keyword%' ";
				}
				else if($cateid)
				{
					$condition=" and CateID='$cateid' ";
				}
				else if($hid)
				{
					$condition=" and CateID like '$hid%' ";
				}
				
				$SQL="SELECT * FROM `hy_b_sys_products`  where 1 $condition   and Lang='".$cfg_cur_lan."'   ";
				$result=mysql_query($SQL);
				$total=mysql_num_rows($result);
				//调用pageft()，每页显示10条信息（使用默认的20时，可以省略此参数），使用本页URL（默认，所以省略掉）。
				_PAGEFT($total,6);
				if($total==0) echo "<h3>对不起！没有相关资料</h3>";
				  $SQL2="SELECT * FROM `hy_b_sys_products`  where 1  $condition  and Lang='".$cfg_cur_lan."'   order by `SortNum` asc,`SysProductsID`  desc limit $firstcount,$displaypg  ";
				$result=mysql_query($SQL2);
				while($value=mysql_fetch_array($result)){
				?>
	   <?php if($hid == 111) { ?>
            <li>
            <p class="p1"><a href="?action=addcart&prid=<?=$value['SysProductsID']?>&cityid=<?=$cityid?>">  <img class="photo" alt="<?=$value['ProductName']?>" src="admin/pic.php?imagename=../uploadfile/product_b/<?=$value['Photos1']?>&amp;imagewidth=339&amp;imageheight=205&amp;cuteit=0" 
					   onerror="javascript:this.src='images/1.jpg'"  
					  /> </a></p>
            <p class="p2"><a href="?action=addcart&prid=<?=$value['SysProductsID']?>&cityid=<?=$cityid?>"><?=$value['ProductName']?></a></p>
			
			
            <p class="p2"><a href="?action=addcart&prid=<?=$value['SysProductsID']?>&cityid=<?=$cityid?>">
			所需价格:
			<?=$value['Price']?></a></p>
            </li>
			<? }else{?>
			  <li>
            <p class="p1"><a href="forpay.php?prid=<?=$value['SysProductsID']?>&jf=1&cityid=<?=$cityid?>">  <img class="photo" alt="<?=$value['ProductName']?>" src="admin/pic.php?imagename=../uploadfile/product_b/<?=$value['Photos1']?>&amp;imagewidth=339&amp;imageheight=205&amp;cuteit=0" 
					   onerror="javascript:this.src='images/1.jpg'"  
					  /> </a></p>
            <p class="p2"><a href="forpay.php?prid=<?=$value['SysProductsID']?>&jf=1&cityid=<?=$cityid?>"><?=$value['ProductName']?></a></p>
			
			
       
			<p class="p2"><a href="forpay.php?prid=<?=$value['SysProductsID']?>&jf=1&cityid=<?=$cityid?>">
			 所需积分:
			<?=$value['Price']?></a></p>
			
            </li>
			
           <? }}?>
       </ul>
      </div>
      </div>
	  	<div align="center"> <?php echo $pagenav; ?></div>
      <div class="bot"></div>
   </div>
   </div>
</div>  
<div class="gehang"></div>  
<div style="width:980px;height:100%;overflow:hidden;margin-top:10px">
    	<img src="images/copy_line.jpg" /><br /><br /><br />
        <img src="images/copy.jpg" />
        <?php include_once('help.php');?>
        <img src="images/copy_line.jpg" />
    </div>    
</div>

<div class="clear"></div>
<?php include_once('footer.php');?>

</body>
</html>
